<?php
/*
	
*/
defined('BY_JYA') or exit('Access Denied');
global $_RQ,$_AR;

$_RQ['op']=$_RQ['op']?$_RQ['op']:'list';
$return=array();
$return['role']=$_SESSION['role'];
if($_RQ['op']=='list'){
	$pindex = max(1, intval($_SESSION['page']));
	$psize = 15;
	$params=array('uniacid'=>$_SESSION['uniacid'],'mid'=>$_SESSION['uid']);
    $fields=array('id','createtime','message');
    $orderby='createtime desc';
	$total='';
	$return['list']=pdo_getslice('jy_taxi_message',$params,array($pindex,$psize),$total,$fields,'',$orderby);	
	foreach($return['list'] as &$v){
			$v['createtime']=date('Y-m-d H:m:s',$v['createtime']);
	}
	$member=pdo_get('jy_taxi_driver',array('mid'=>$_SESSION['uid']));
	$info=model('core/member')->basic($_SESSION['uid']);
	if(!$member){
		$member=pdo_get('jy_taxi_member',array('mid'=>$_SESSION['uid']));
		if(!$member){
		$member['user']='no';	
		}else{
		$member['user']='member';
		}
	}else{
		$member['user']='driver';
	}
	$member['nickname']=$info['nickname'];
	$member['avatar']=$info['avatar'];
	$member['credit2']=$info['credit2'];
	$return['member']=$member;
	exi($return);
}
